package com.weex.app;

import android.content.Intent;
import android.graphics.Typeface;
import android.net.Uri;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.widget.TextView;

import java.util.Timer;
import java.util.TimerTask;


public class SplashActivity extends AppCompatActivity {


  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    TextView textview = (TextView) findViewById(R.id.fullscreen_content);

    Typeface typeface = Typeface.createFromAsset(getAssets(),"font/zhs.ttf"); // create a typeface from the raw ttf
    textview.setTypeface(typeface); // apply the typeface to the textview

    Timer timer = new Timer();
    TimerTask task = new TimerTask() {
      @Override
      public void run() {
        Intent intent = new Intent(SplashActivity.this, WXPageActivity.class);
        Uri data = getIntent().getData();
        if (data != null) {
          intent.setData(data);
        }
        intent.putExtra("from", "splash");
        startActivity(intent);

        finish();
      }
    };
    timer.schedule(task, 1000);

  }
}
